<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
header('Access-Control-Allow-Origin: *');
header('Access-Control-Max-Age: 1800');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
header('Access-Control-Allow-Headers: Api-Auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With');
Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});
Route::get('hello/:name', 'index/hello');
Route::group('sys',function (){
    Route::rule('login','sys.Login/sign');
    Route::rule('today','sys.count/today');
    Route::rule('total','sys.count/total');
    Route::rule('evday','sys.count/evday');
    Route::rule('channel','sys.count/channel');
    Route::group('user',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
        Route::group('basic',function (){
            Route::rule('save','basic_save');
        });
    })->prefix('sys.user/');
    Route::group('admin',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
    })->prefix('sys.admin/');
    Route::group('channel',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
    })->prefix('sys.channel/');
    Route::group('role',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
    })->prefix('sys.role/');
    Route::group('config',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
    })->prefix('sys.config/');
    Route::group('pay',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
        Route::group('config',function (){
            Route::post('order','create_config_order');
            Route::post('list','config_list');
            Route::rule('info','config_info');
            Route::post('save','config_save');
            Route::rule('delete','config_del');
        });
        Route::group('order',function(){
            Route::post('list','order_list');
            Route::rule('info','order_info');
            Route::post('save','order_save');
            Route::rule('delete','order_del');
            Route::post('find','pay2_order_find_status');
        });
        Route::group('amount',function(){
            Route::post('pay','amount_pay');
        });
        Route::group('pay',function(){
            Route::post('pay1','pay_pay1');
            Route::post('pay2','pay_pay2');
        });
    })->prefix('sys.pay/');
    Route::group('order',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::post('kefu','kefu');
        Route::rule('delete','del');
        Route::group('pay',function (){
            Route::post('supplement','supplement_order');
            Route::post('create','create_pay_order');
        });
    })->prefix('sys.order/');
    Route::group('sms',function(){
        Route::post('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','del');
        Route::group('content',function(){
            Route::post('list','content_list');
            Route::rule('info','content_info');
            Route::post('save','content_save');
            Route::rule('delete','content_del');
        });
    })->prefix('sys.sms/');
    Route::group('count',function(){
        Route::rule('app','app');
        Route::rule('kefu','kefu');
    })->prefix('sys.count/');
})->middleware([\app\middleware\Sys::class]);
Route::group('app',function (){
    Route::rule('login','app.Login/sign');
    Route::rule('config','app.config/list');
    Route::rule('click','app.user/is_click_kefu');
    Route::group('user',function(){
        Route::rule('info','info');
        Route::post('save','save');
        Route::group('click',function (){
            Route::rule('pay','pay_click');
            Route::rule('kefu','kefu_click');
        });
    })->prefix('app.user/');
    Route::group('order',function(){
        Route::rule('info','info');
        Route::post('create','create');
        Route::post('update','update');
        Route::group('amount',function (){
            Route::post('pay','amount_pay');
        });
        Route::group('pay',function(){
            Route::rule('info','pay_info');
            Route::rule('url','pay_url');
        });
    })->prefix('app.order/');
})->middleware([\app\middleware\App::class]);
Route::rule('code','sms/code');
Route::post('upload','upload/upload');
Route::rule('v_code','sms/v_code');
Route::rule('send','sms/send');
Route::rule('callback','callback/pay_callback');
Route::miss(function(){return "路径错误";});